/**
 * 
 */
package com.cr.backbone.init;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.readnote.user.model.User;
import com.readnote.user.service.UserService;

/**
 * @project RaedNote
 * @version 1.0
 * @company 
 * @fileDescribe
 * @fileType InitAppServlet InitAppServlet.java
 * @author xianghua.hu
 * @date 2012-5-16 下午03:45:24
 */
/**
 * @author huxh
 *
 */
public class InitAppServlet extends HttpServlet {

	@Override
	public void init() throws ServletException {
		super.init();
		
		//程序启动，初始化
		ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath:spring/applicationContext-*.xml");
		UserService userService =(UserService) classPathXmlApplicationContext.getBean("UserService");
		
		User admin=userService.getUserByLoginName("admin");
		if(admin==null||admin.isNullRow())
			init();
		
		
		
	}

	
}
 